#include "mystdio.h"
#include <string.h>
#include <unistd.h>

int main()
{
  MyFile *filep = MyFopen("./log.txt", "a");
  if(!filep)
  {
    printf("fopen error\n");
    return 1;
  }

  int cnt = 10;
  while(cnt--)
  {
    const char *msg = "hello bit!!!!";
    MyFwrite(filep, msg, strlen(msg));

    printf("buffer: %s\n", filep->outbuff);
    sleep(1);
  }
  MyFclose(filep);

  return 0;
}
